package com.usian.search.controller;

import com.usian.apis.article.ArticleInfoControllerApi;
import com.usian.apis.search.ArticleSearchControllerApi;
import com.usian.model.article.dtos.ArticleInfoDto;
import com.usian.model.common.dtos.ResponseResult;
import com.usian.model.search.dtos.UserSearchDto;
import com.usian.search.service.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/search")
public class ArticleSearchController implements ArticleSearchControllerApi {

    @Autowired
    private SearchService searchService;

    /**
     * 文章搜索
     *
     * @param userSearchDto
     * @return
     */
    @Override
    @PostMapping("/search")
    public ResponseResult search(@RequestBody  UserSearchDto userSearchDto) {
        return searchService.search(userSearchDto);
    }



}
